

import type { Istorecoupon } from './entity';
import type { IPageParams } from '@/types/table'
import request from '@/api/request'

export function getPageList(params: IPageParams) {
  return request({
    url: `/admin/marketing/coupon/list`,
    method: 'get',
    params,
    loading: true
  })
}

export function storecouponDel(data) {
  return request({
    url: `/admin/marketing/coupon/delete`,
    method: 'post',
    data
  })
}
export function storecouponinfo(id) {
  return request({
    url: `/admin/marketing/coupon/info`,
    method: 'post',
    params: { id }
  })
}

export function storecouponAddup(data) {
  return request({
    url: `/admin/marketing/coupon/${!data.id ? 'save' : 'update'}`,
    method: 'post',
    data
  })
}

export function couponuser(params: IPageParams) {
  return request({
    url: `admin/marketing/coupon/user/list`,
    method: 'get',
    params,
    loading: true
  })
}

export function storecouponuserDel(data) {
  return request({
    url: `admin/marketing/coupon/user/delete`,
    method: 'post',
    data
  })
}
export function storecouponuserinfo(id) {
  return request({
    url: `admin/marketing/coupon/user/info/${id}`,
    method: 'get'
  })
}
export function storecouponuserSelect(id) {
  return request({
    url: `admin/marketing/coupon/user/select`,
    method: 'get'
  })
}

export function storecouponuserAddup(data) {
  return request({
    url: `admin/marketing/coupon/user/${!data.id ? 'save' : 'update'}`,
    method: 'post',
    data
  })
}